﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WebInterface;
using WebReposity.Models;

namespace WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class FirstController : ControllerBase
    {
        private readonly IWebApiServiceA _webApiServiceA;

        public FirstController(IWebApiServiceA webApiServiceA)
        {
            _webApiServiceA = webApiServiceA;
        }


        [HttpGet]
        public IActionResult Index()
        {
            return Ok("welcome");
        }

        [HttpGet]
        public ActionResult<double> CalculateValue(int a,int b)
        {
            return _webApiServiceA.DeivdeValue(a, b);
        }


        [HttpPost]
        public ActionResult<string> DoEasyThing(WebApiDtoB a)
        {
            return _webApiServiceA.DoEasything(a);
        }

    }
}